﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title>宾果高校</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/sweetalert.min.css" />
    <script src="../js/jquery-1.12.2.min.js"></script>
    <script src="../js/validator.min.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/login.js"></script>
    <script src="../js/angular.min.js"></script>
    <script src="../js/Controller.js"></script>
    <script src="../js/store.min.js"></script>
    <script src="../js/sweetalert.min.js"></script>
    <script>

        common.commonAjax({ type: 'Get', url: '../api/project/GetBooks', sMethod: AfteAjax });

        function AfteAjax(ctx) {

            if (ctx == "" || ctx == null) {
                window.location = "../login.html";
                return;
            }

            var data = ctx.ResponseList;
            if (data.length == 0) {
                alert("匹配前需要提供至少一份赞助书");
                return;
            }

            for (var i = 0; i < data.length; i++) {
                $("#ProjectNO").append("<option value='" + data[i].ProjectNO + "'>" + data[i].ProjectName + "</option>")
            }
        }

        function Go() {

            if (!common.validateForm())
                return;

            var values = common.GetCtrlValues({
                ContentID: "formValidate"
            })

            store.set("selectParams", values);

            window.location = "result.html";
        }

    </script>
</head>
<body>
    <div id="searchPage"></div>
    <div style="padding-top: 20px;" class="main">
        <div class="wrap">
            <div class="select-header">
                <div class="panel panel-default">
                    <div style="margin: 0 auto;width: 600px;" class="panel-body">
                        <form id="formValidate" action="" class="form-horizontal">
                            <div class="form-group">
                                <label for="">社团类型：</label>
                                <br>
                                <label for="">
                                    <input type="checkbox" name="EntrantsName" value="900000112"><span>组织类（学生会、团委、社团联合会等官方组织）</span>
                                </label>
                                <label for="">
                                    <input type="checkbox" name="EntrantsName" value="900000113"><span>社团类（青年志愿者服务队，红十字会，体育类社团，棋牌类社团，动漫社，文娱类社团，语言类社团，兴趣类社团，其他社团）</span>
                                </label>
                            </div>
                            <div class="form-group">
                                <select class="form-control" id="ProjectNO" data-error="请选择赞助书" required min="1">
                                    <option value="">请选择赞助书</option>
                                </select>
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <input type="number" id="Money" placeholder="企业提供总赞助金额" data-error="请填写企业提供总赞助金额" required class="form-control">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <input type="number" id="LikedCount" placeholder="所需社团总数" data-maxlength="3" data-error="请填写所需社团总数" required class="form-control">
                                <div class="help-block with-errors"></div>
                            </div>

                            <div class="text-center">
                                <button type="button" class="btn btn-default" onclick="Go()">提交</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script>
    $("#searchPage").load("header.html", function () {
        SetCss("Select");
    });
</script>